<template>
    <el-card class="box-card">
            <h2>{{ news.title }}</h2>
            <div>{{ news.content }}</div>
    </el-card>
</template>

<script>
export default {
    name:'NewsDetail',
    mounted(){
        this.getNewsContent(this.$route.query.id);
    },
    data:function(){
        return{
            news:{}
        }
    },
    methods:{
        getNewsContent(id){
            this.$axios({
                url:'/easybuy/news/getone',
                params:{
                    id
                }
            }).then(rs=>{
                this.news = rs.data.news;
            })
        }
    }
}
</script>

<style scoped>
  .box-card {
    width: 880px;
    height: 900px;
  }
</style>